package com.ceair.utils;

import com.ceair.entity.ActReDeployment;
import com.ceair.entity.vo.ActReDeploymentVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author wangbaohai
 * @ClassName ActReDeploymentStructMapper
 * @description: 活动部署基础信息结构映射器
 * @date 2025年04月21日
 * @version: 1.0.0
 */
@Mapper
public interface ActReDeploymentStructMapper {

    // 映射器的实例，通过Mappers工具类获取
    ActReDeploymentStructMapper INSTANCE = Mappers.getMapper(ActReDeploymentStructMapper.class);

    /**
     * 将ActReDeployment实体转换为VO(view object)对象
     * @param actReDeployment 不得为空的ActReDeployment实体
     * @return 转换后的ActReDeploymentVO对象
     */
    default ActReDeploymentVO toVO(ActReDeployment actReDeployment) {
        if (actReDeployment == null) {
            throw new IllegalArgumentException("Input parameter 'actReDeployment' cannot be null.");
        }
        return mapToVO(actReDeployment);
    }

    /**
     * 实际执行ActReDeployment到ActReDeploymentVO转换的方法
     * @param actReDeployment ActReDeployment实体
     * @return 转换后的ActReDeploymentVO对象
     */
    ActReDeploymentVO mapToVO(ActReDeployment actReDeployment);

    /**
     * 将ActReDeploymentVO对象转换回ActReDeployment实体
     * @param actReDeploymentVO 不得为空的ActReDeploymentVO对象
     * @return 转换后的ActReDeployment实体
     */
    default ActReDeployment toEntity(ActReDeploymentVO actReDeploymentVO) {
        if (actReDeploymentVO == null) {
            throw new IllegalArgumentException("Input parameter 'actReDeploymentVO' cannot be null.");
        }

        return mapToEntity(actReDeploymentVO);
    }

    /**
     * 实际执行ActReDeploymentVO到ActReDeployment转换的方法
     * @param actReDeploymentVO ActReDeploymentVO对象
     * @return 转换后的ActReDeployment实体
     */
    ActReDeployment mapToEntity(ActReDeploymentVO actReDeploymentVO);

}
